<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ page import="java.util.*"%>
<%@ page import="ils.web.model.*"%>
<%@ page import="org.apache.log4j.Logger"%>
<%@ page import="com.opensymphony.xwork2.*"%>
<%@ page import="com.opensymphony.xwork2.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<link rel="stylesheet" type="text/css" href="main.css" />
<title>Search Results</title>
</head>
<body>
	<%@include file="header.jsp"%>
	<article> <s:set name="jbooks" value="books" scope="request" />
	<s:set name="jtype" value="type" scope="request" /> <s:set
		name="jterm" value="term" scope="request" /> <%
     Logger logger = Logger.getLogger(this.getClass());
 %> <c:choose>
		<c:when test="${empty jbooks }">
			There are no books found for type: ${jtype } and search term: ${jterm } !<br />
		</c:when>
		<c:otherwise>
			Books for ${jtype }: ${jterm } <br />
			<table>
				<tr>
					<th style="width: 100px">Title</th>
					<th style="width: 100px">Author</th>
					<th style="width: 100px">Publisher</th>
				</tr>
				<c:forEach var="item" items="${jbooks}">
					<tr>
						<td><a href="bookDetails?bookId=${item.id}">${item.title}</a></td>
						<td>${item.author}</td>
						<td>${item.publisher}</td>
					</tr>
				</c:forEach>
			</table>
		</c:otherwise>
	</c:choose> </article>
	<%@include file="footer.jsp"%>
</body>
</html>